﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Xml.Linq;


/// <summary>
/// This class is for mockuos purposes only, to be able to add controls on the run, and quickly, with no passed parameters
/// </summary>

namespace Mockups.UIControls
{
	public class UI : UserControl
	{
		public string path;

		public UI()
		{
		}
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			// load the control from controls folder with same path, this is for generic quick things
			UserControl newcontrol = (UserControl)Page.LoadControl(ResolveUrl("~/controls/" + path + ".ascx"));
			this.Controls.Add(newcontrol);
			foreach (string key in Attributes.Keys)
			{
				newcontrol.Attributes.Add(key, Attributes[key]);
			}

		}
	}

	
}